package interview.java.q1.internal.secret;

import interview.java.q1.internal.AnswerResultPrinter;
import interview.java.q1.internal.QuestionInputReader;
import interview.java.q1.internal.StringListConverter;
import java.util.Arrays;
import java.util.stream.Collectors;

public class Main2 {

  public static void main(String[] args) {
    new Main2().start();
  }

  void start() {
    QuestionInputReader reader = QuestionInputReader.create();
    for (int i = reader.read(); i > 0; i = reader.read()) {
      int[][] result = new AnswerResultMaker(i).make();

      System.out.println("输出：");
      new AnswerResultPrinter(Arrays.stream(result)
          .map(l -> new StringListConverter(l).convert())
          .collect(Collectors.toList()), ' ').print();
    }
  }
}
